// 数组泛型
// Array<string> 代表 数组类型，里面的值是字符串类型
const arr1: Array<string> = ["hello", "aaa", "bbb"];
const arr2: Array<string | number> = ["hello", "aaa", "bbb", 123, 456];

// 方括号表示法
const arr3: number[] = [1, 2, 3];
const arr4: (number | string)[] = [1, 2, 3, "string"];

// 接口表达数组类型(一般不用)
interface Arr {
	[index: number]: number;
}

interface Child {
	name: string;
	age: number;
}

interface Person {
	name: string;
	children: Child[];
}

const arr5: Person[] = [{ name: "aaa", children: [{ name: "bbb", age: 18 }] }];
